/**
 * 
 */
package jnzb.ui;

import java.io.File;

import javax.swing.filechooser.FileFilter;

/**
 * File filter for NZB files.
 * @author Rid
 *
 */
public class nzbFilter extends FileFilter {

	/**
	 * 
	 */
	public nzbFilter() {
	}

	/**
	 * Accepts all files that have nzb in them somewhere!
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	@Override
	public boolean accept(File file) {
		boolean ok=true;
		ok |= file.getName().toLowerCase().endsWith("nzb");
		ok |= file.isDirectory();
		return ok;
	}

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#getDescription()
	 */
	@Override
	public String getDescription() {
		return "NZB Files";
	}

}
